<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            width: 100%;
            height: 100%;
            /* border: 1px solid green; */
            overflow: hidden;
        }
        .sliderbar {
            margin-top: 30px;
            position: absolute;
            right: 0;
            height: 20px;
            display: flex;
            justify-content: start;
            cursor: pointer;
        }

        span{
            position: absolute;
            right: 0px;
            width: 40px;
            height: 20px;
            background-color: pink;
            z-index: 1;
            
        }

        .con{
            position: absolute;
            cursor: pointer;
            left: 200px;
            height: 20px;
            width: 200px;
            background-color: pink;
        }

    </style>
</head>
<body>
    <div class="sliderbar">
        <span>←</span>
        <div class="con">问题反馈</div>
    </div>
    <script src="./animate.js"></script>
    <script>
        var sliderbar = document.querySelector('.sliderbar');
        var con = document.querySelector('.con');
        var span = document.querySelector('span')
        //当我们鼠标经过 sliderbar 就会让 con这个盒子滑动到左侧
        //当鼠我们标离开 sliderbar 就会让 con这个盒子滑动到右侧
        sliderbar.addEventListener('mouseenter', function() {
            //animation(obj, target, clllback);
            animate(con, -160);
            span.innerHTML = '→';
        })
        sliderbar.addEventListener('mouseleave', function() {
            //animation(obj, target, clllback);
            animate(con, 160);
            span.innerHTML = '←';
        })
    </script>
</body>
</html>